#!/bin/bash
source /etc/profile
. $BEETLE_SHELL_PATH/error.sh

# 分支名
branch=$1

codePath=/usr/local/beetle/code/beetle-ui
workPath=/usr/local/nginx
projectName=beetle
configPath=/usr/local/beetle/config/beetle-ui
bakPath=/usr/beetle/appbak/beetle-ui
bakName=beetle-ui

bash $BEETLE_SHELL_PATH/git_checkout.sh ${codePath} ${branch} || error_exit

bash $BEETLE_SHELL_PATH/bak.sh ${workPath} ${projectName} ${bakPath} ${bakName} || error_exit

cd ${codePath} || error_exit

cp -Rf `ls |grep -v config.js` ${workPath}/${projectName}/ || error_exit

cp ${configPath}/config.js ${workPath}/${projectName}/ || error_exit
